RewriteEngine On
RewriteBase /<?php echo ($this->siteDir) ? $this->siteDir . "/\n" : "\n"; ?>

RewriteRule ^\.htaccess$ - [F]
<?php echo (false !== $this->additionalRules) ? $this->additionalRules . "\n" : ''; ?>
#canonicalization do not remove!
#{%canonic_rules%}
#end canonicalization
RewriteRule ^index\.html$ <?php echo $this->websiteUrl . " [R=permanent,L] \n"; ?>
RewriteRule ^index\.htm$ <?php echo $this->websiteUrl . " [R=permanent,L] \n"; ?>
#301 redirect
<?php if(!empty ($this->redirectTable)): ?>
<?php foreach ($this->redirectTable as $redirect => $data){
if((bool)preg_match('/^https?:\/\//', $data['currUrl'])){ ?>
RewriteRule ^<?php echo str_replace('\\\\', '',urldecode($data['oldUrl'])); ?>$ <?php echo urldecode($data['currUrl']); ?> [R=permanent,L]
<?php }else{ ?>
RewriteRule ^<?php echo str_replace('\\\\', '',urldecode($data['oldUrl'])); ?>$ <?php echo $this->websiteUrl .urldecode($data['currUrl']); ?>.html [R=permanent,L]
<?php }	?>
<?php } ?>
<?php endif; ?>
#end 301
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule !\.(js|ico|jpeg|jpg|gif|png|css|pdf|mov|mp3|lng)$ index.php